package com.kaily.timemanager.db;

import android.content.Context;

import com.app.common.db.sqlite.BaseCipDBHelper;


import net.sqlcipher.database.SQLiteDatabase;

/**
 * Created by zhoulikai on 17/2/27.
 */

public class AppBaseCipDBHelper extends BaseCipDBHelper {


    public AppBaseCipDBHelper(Context context) {
        super(context, AppDatabase.Db.DBNAME, null, AppDatabase.Db.DBVERSION);
    }

    @Override
    public void createTable(SQLiteDatabase db) {
        db.execSQL(AppDatabase.Db.SQL_CREATE_TASK_CLASS_ENTRIES);
        db.execSQL(AppDatabase.Db.SQL_CREATE_TASK_ENTRIES);
        db.execSQL(AppDatabase.Db.SQL_CREATE_THINK_ENTRIES);
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int i, int i1) {
        super.onUpgrade(db, i, i1);
        db.execSQL(AppDatabase.Db.SQL_DELETE_TASK_CLASS_ENTRIES);
        db.execSQL(AppDatabase.Db.SQL_DELETE_TASK_ENTRIES);
        db.execSQL(AppDatabase.Db.SQL_DELETE_THINK_ENTRIES);
        onCreate(db);

    }
}
